package com.peking.donations.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * 数据源配置
 * <p>
 * Created by WYZ on 16/3/24.
 */
@Configuration
public class DataSourceConfiguration {

    /**
     * 定义数据源 ,参数来自 application.yml 中前缀为druid
     *
     * @return
     */
    @Bean
    @ConfigurationProperties(prefix = "druid")
    public DataSource druidDataSource() {
        return new DruidDataSource();
    }


}
